import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const stores =  new Vuex.Store({
    state:{
        appId:null,
        appCode:null,
        appSecret:null,
        uid:null,
        grade:null,
        answerList:[],  //习题集合
        mistakesList:[],    //错题本列表
        num1:1,
        num2:3,
        isTV:false,
    },
    mutations:{
        changeNum(state,data){
            state.num1 = data;
        }
    },
    
    getters:{
        sum(state){
            return state.num1 + state.num2;
        }
    },

    actions:{
        async getState({commit}){
            commit("changeNum",1)
        }
    },
    modules:{}
})
export default stores